package Nvwa;

public class Nvwa {
    public static Person getPerson(String type) {
        Person person = null;
        if (type.equalsIgnoreCase("M")) {
            person = new Man();
            System.out.println("创造男人");
        } else if (type.equalsIgnoreCase("W")) {
            person = new Woman();
            System.out.println("创造女人");
        } else if (type.equalsIgnoreCase("R")) {
            person = new Robot();
            System.out.println("创造机器人");
        }
        return person;
    }
}
